import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import top.ysh.config.SpringConfig;
import top.ysh.domain.Account;
import top.ysh.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        // ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        // AccountService accountService = (AccountService) ctx.getBean("accountService");
        // Account ac = accountService.findById(2);
        // System.out.println(ac);

        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        AccountService accountService = ctx.getBean("accountService", AccountService.class);
        Account byId = accountService.findById(2);
        System.out.println("byId = " + byId);

    }
}
